<?php
/**
 * XmlRpc编码接口
 *
 * 测试：
 * <code>
 * $object = new stdClass();
 * $object->a = 111;
 * $object->b = "mmm";
 * $xml = new XmlRpcArrayEncoder(array(
 * 				"a" => array(1, 2, 3, 4),
 * 				"b" => 1,
 * 				"c" => 3.14,
 * 				"d" => "kiki",
 * 				"e" => NULL, 
 * 				"f" => false,
 * 				"g" => $object
 * 		));
 * 
 * echo htmlspecialchars($xml->asXmlString());
 * </code>
 * 
 * 结果：
 * <code>
 * <array><data><value><array><data><value><i4>1</i4></value><value><i4>2</i4></value><value><i4>3</i4></value><value><i4>4</i4></value></data></array></value><value><i4>1</i4></value><value><double>3.14</double></value><value><string>kiki</string></value><value><string></string></value><value><boolean>0</boolean></value><value><struct><member><name>a</name><value><i4>111</i4></value></member><member><name>b</name><value><string>mmm</string></value></member></struct></value></data></array> 
 * </code>
 * 
 * @version $Id: XmlRpcEncoder.php 312 2008-04-23 16:29:38Z iwind $
 * @package net.4kiki.rai.format.xmlrpc.encoder
 * @since 0.0.3
 */
interface XmlRpcEncoder {
	/**
	 * 构造器
	 *
	 * @param mixed $phpVar PHP变量
	 * @param string $charset 字符集
	 */
	public function __construct($phpVar, $charset = "UTF-8");
	
	/**
	 * 转化成XML字符串
	 *
	 * @return string
	 */
	public function asXmlString();
}

?>